//
//  MoreViewController.m
//  Chirismus
//
//  Created by wangning on 15/11/2.
//  Copyright © 2015年 mohe. All rights reserved.
//

#import "MoreViewController.h"
#import "Define.h"
#import "HelpViewController.h"
#import "ActivitiViewController.h"

@interface MoreViewController (){
    UIButton * leftBtn;
    UIButton * rightBtn;
    //NSArray * arr;
}

@end

@implementation MoreViewController

- (void)viewDidLoad {
    [super viewDidLoad];
    
    self.navigationController.navigationBar.titleTextAttributes = [NSDictionary dictionaryWithObject:[UIColor whiteColor] forKey:NSForegroundColorAttributeName];
    self.title=@"更多";
    [self write];
    self.view.backgroundColor = [UIColor whiteColor];
    // Do any additional setup after loading the view from its nib.
}

- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}

- (void)viewWillAppear:(BOOL)animated{
    delegate = (AppDelegate*)[[UIApplication sharedApplication]delegate];;
    [delegate.tabBar showTabBar];
}

-(void)write{
    leftBtn = [[UIButton alloc]initWithFrame:CGRectMake(5*F_WIDTH, 218*F_HEIGHT, WIDTH, 65*F_HEIGHT)];
    
    UILabel * helpLabel =[[UILabel alloc]initWithFrame:CGRectMake(55*F_WIDTH, 13*F_HEIGHT, 90*F_WIDTH, 40*F_HEIGHT)];
    helpLabel.text = @"盲人求助";
    helpLabel.font = [UIFont systemFontOfSize:17];
    helpLabel.textColor = [UIColor grayColor];
    
    [leftBtn setTitleColor:[UIColor grayColor] forState:UIControlStateNormal];
    [leftBtn setTitleColor:[UIColor orangeColor] forState:UIControlStateSelected];
    
    
    UIImageView * topImg = [[UIImageView alloc]initWithFrame:CGRectMake(0*F_WIDTH, 13*F_HEIGHT, 40*F_WIDTH, 40*F_HEIGHT)];
   topImg.image = [UIImage imageNamed:@"爱心"];
    
    
    leftBtn.titleLabel.font= [UIFont systemFontOfSize:17];
    
    [leftBtn addTarget:self action:@selector(leftJump) forControlEvents:UIControlEventTouchUpInside];
    
    UILabel * activiabel =[[UILabel alloc]initWithFrame:CGRectMake(55*F_WIDTH,13*F_HEIGHT, 90*F_WIDTH, 40*F_HEIGHT)];
    activiabel.text = @"商家活动";
    activiabel.font = [UIFont systemFontOfSize:17];
    activiabel.textColor = [UIColor grayColor];
    
    rightBtn = [[UIButton alloc]initWithFrame:CGRectMake(5*F_WIDTH,290*F_HEIGHT,WIDTH, 65*F_HEIGHT)];
    
    [rightBtn setTitleColor:[UIColor grayColor] forState:UIControlStateNormal];
    [rightBtn setTitleColor:[UIColor orangeColor] forState:UIControlStateSelected];
    rightBtn.titleLabel.font= [UIFont systemFontOfSize:17];
    
    
    UIImageView * downImg = [[UIImageView alloc]initWithFrame:CGRectMake(0*F_WIDTH,15*F_HEIGHT, 40*F_WIDTH, 40*F_HEIGHT)];
    
    downImg.image = [UIImage imageNamed:@"促销"];
    UIButton * jiantouImgOne = [[UIButton alloc]initWithFrame:CGRectMake(265*F_WIDTH, 245*F_HEIGHT, 13*F_WIDTH, 20*F_HEIGHT)];
    
    [jiantouImgOne setBackgroundImage:[UIImage imageNamed:@"蓝色回箭头"] forState:UIControlStateNormal];
    
    
    UIButton * jiantouImg = [[UIButton alloc]initWithFrame:CGRectMake(265*F_WIDTH, 312*F_HEIGHT, 13*F_WIDTH, 20*F_HEIGHT)];
    
    [jiantouImg setBackgroundImage:[UIImage imageNamed:@"蓝色回箭头"] forState:UIControlStateNormal];
    
    [rightBtn addTarget:self action:@selector(rightJump) forControlEvents:UIControlEventTouchUpInside];
    
    UIImageView * backImg = [[UIImageView alloc]initWithFrame:CGRectMake(0, 0, WIDTH, 200*F_HEIGHT)];
    backImg.image = [UIImage imageNamed:@"背景"];
    // backImg.userInteractionEnabled = YES;
    
    //绘制细线分割
    UIView * line = [[UIView alloc]initWithFrame:CGRectMake(0, 200*F_WIDTH,WIDTH, 18*F_HEIGHT)];
    line.backgroundColor = [UIColor colorWithRed:242/255.0 green:242/255.0 blue:242/255.0 alpha:1.0];
    
    
    
    UIView * lineOne = [[UIView alloc]initWithFrame:CGRectMake(0, 285*F_WIDTH,WIDTH, 2*F_HEIGHT)];
    lineOne.backgroundColor = [UIColor colorWithRed:242/255.0 green:242/255.0 blue:242/255.0 alpha:1.0];
    
    UIView * lineTwo = [[UIView alloc]initWithFrame:CGRectMake(0, 355*F_WIDTH,WIDTH, 18*F_HEIGHT)];
    lineTwo.backgroundColor = [UIColor colorWithRed:242/255.0 green:242/255.0 blue:242/255.0 alpha:1.0];
    
    

    [self.view addSubview:line];
    [self.view addSubview:lineOne];
    [self.view addSubview:lineTwo];
    [leftBtn addSubview:helpLabel];
    [rightBtn addSubview:activiabel];
    
    
    [self.view addSubview:jiantouImgOne];
    [self.view addSubview:jiantouImg];
    [leftBtn addSubview:topImg];
    [rightBtn addSubview:downImg];
    [self.view addSubview:leftBtn];
    [self.view  addSubview:rightBtn];
    [self.view addSubview:backImg];
    
}

-(void)leftJump{
    
    leftBtn.selected = YES;
    rightBtn.selected = NO;
    HelpViewController * vc = [[HelpViewController alloc]init];
    [self.navigationController pushViewController:vc animated:YES];
    
}

-(void)rightJump{
    
    leftBtn.selected = NO;
    rightBtn.selected = YES;
    
    ActivitiViewController * vc = [[ActivitiViewController alloc]init];
    [self.navigationController pushViewController:vc animated:YES];
    
}


@end
